package com.zf.museum.repository;

import com.zf.museum.model.*;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RecordRepository extends JpaRepository<Record, Long>{

    Record getRecordByUser(User user);

    @Query("select r.multiChoices from Record r where r.user=?1")
    List<MultiChoices> getMultiChoices(User user);

    @Query("select r.singleChoices from Record r where r.user=?1")
    List<SingleChoice> getSingleChoice(User user);

    @Query("select r.tfngs from Record r where r.user=?1")
    List<Tfng> getTfng(User user);
}
